package com.clstu.date_;

import java.time.Instant;
import java.util.Date;

public class Instant_ {
    public static void main(String[] args) {
        //时间戳对象，类似于Date对象，可以相互转换
        Instant i=Instant.now();
        System.out.println(i);

        Date date = Date.from(i);
        System.out.println(date);//Instant--》Date

        Instant instant=date.toInstant();
        System.out.println(instant);//Date-->Instant
    }

}
